Merb::Router.prepare do |r|
  r.match('/').to(:controller => 'simple', :action =>'index')
  r.match('/line/:id').to(:controller => 'simple', :action =>'line')
end
class Simple < Merb::Controller
  def index
   %Q(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>This is a test</title></head><body>
  hello there world
  line 1: <pre><esi:try><esi:attempt><esi:include max-age='0' src='/line/1'/></esi:attempt><esi:except>line 1 failed</esi:except></esi:try></pre>
  some more bytes here
  line 2: <pre><esi:try><esi:attempt><esi:include max-age='0' src='/line/2'/></esi:attempt><esi:except>line 1 failed</esi:except></esi:try></pre>
  and some more here
  some more bytes here
  line 3: <pre><esi:try><esi:attempt><esi:include max-age='0' src='/line/3'/></esi:attempt><esi:except>line 1 failed</esi:except></esi:try></pre>
  and some more here
  some more bytes here
  line 4: <pre><esi:try><esi:attempt><esi:include max-age='0' src='/line/4'/></esi:attempt><esi:except>line 4 failed</esi:except></esi:try></pre>
  line 5: <pre><esi:try><esi:attempt><esi:include max-age='0' src='/line/5'/></esi:attempt><esi:except>line 5 failed</esi:except></esi:try></pre>
  line 6: <pre><esi:try><esi:attempt><esi:include max-age='0' src='/line/6'/></esi:attempt><esi:except>line 6 failed</esi:except></esi:try></pre>
  line 7: <pre><esi:try><esi:attempt><esi:include max-age='0' src='/line/7'/></esi:attempt><esi:except>line 7 failed</esi:except></esi:try></pre>
  and some more here
  line 8: <pre><esi:include max-age='0' src='/line/8'/></pre>
  and some more here
  some more bytes here
  line 9: <pre><esi:include max-age='0' src='/line/9'/></pre>
  and some more here
</body></html>)
  end

  # read the line given by id of this file
  def line
    h File.read(__FILE__).split("\n")[params[:id].to_i]
  end

end

Merb::Config.use { |c|
  c[:framework]           = {},
  c[:session_store]       = 'none',
  c[:exception_details]   = true
}
